package com.bwie.controller;

import com.bwie.mapper.TbBrandMapper;
import com.bwie.pojo.TbBrand;
import com.bwie.service.TbBrandService;
import com.bwie.utils.Result;
import com.bwie.vo.BrandVo;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description :
 * @Author QiHainan
 * @Create 2025/5/23 16:21
 * @Version 1.0
 */
@RestController
@RequestMapping("/prod/index")
public class IndexController {
    @Autowired
    TbBrandService tbBrandService;

    /**
     * 品牌条件分页列表
     * @param brandVo
     * @return
     */
    @PostMapping("/getBrandPage")
    public Result getBrandPage(@RequestBody BrandVo brandVo){
        return tbBrandService.getBrandPage(brandVo);
    }

    /**
     * 新增品牌
     * @param tbBrand
     * @return
     */
    @PostMapping("/addBrand")
    public Result addBrand(@RequestBody TbBrand tbBrand){
        return tbBrandService.addBrand(tbBrand);
    }

    /**
     * 修改品牌状态
     * @param tbBrand
     * @return
     */
    @PostMapping("/updateBrandStatus")
    public Result updateBrandStatus(@RequestBody TbBrand tbBrand){
        return tbBrandService.updateBrandStatus(tbBrand);
    }


}
